package aom.ju.ss.view.user.shop

import aom.ju.ss.R
import aom.ju.ss.databinding.ApplyShop3Binding
import aom.ju.ss.utils.*
import aom.ju.ss.view.base.BaseActivity
import aom.ju.ss.view.main.LpViewModel

/**
 * 申请店铺填写店铺资料
 */
class ApplyForAShop3Activity : BaseActivity() {

    private lateinit var binding: ApplyShop3Binding


    override fun init() {
        binding = viewBinding as ApplyShop3Binding

        val sp = SpUtils.getString("sq") // 0 个人 1 企业

        binding.info = LpViewModel.getMy().uiData

        binding.sendCode.setOnClickListener {
            sendCode(binding.phone, binding.sendCode)
        }

        binding.go.setOnClickListener {
            if (binding.shopName.text.toString().isEmpty()) {
                "请输入店铺名".show
                return@setOnClickListener
            }
            if (binding.className.text.toString().isEmpty()) {
                "请选择店铺分类".show
                return@setOnClickListener
            }
            if (binding.phone.isPhone && binding.code.isCode) {
                start(ApplyForAShopDataActivity::class.java)
            }

        }

    }

    override val lay = R.layout.apply_shop3
}